|
.NET Framework Beta 2 |
|||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
Represents an open connection to a mySql database.
Constructor Summary | |
---|---|
MySqlConnection() Initializes a new instance of the MySqlSharp.Provider.MySqlConnection class. |
|
MySqlConnection(string connectionString) Initializes a new instance of the MySqlSharp.Provider.MySqlConnection class when given a string containing the connection string. |
Property Summary | |
---|---|
string |
ConnectionString
Gets or sets the connection string used to open a connection with the mySql database. |
int |
ConnectionTimeout
Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error. |
string |
Database
Gets the name of the current database or the database to be used once a connection is open. |
string |
DataSource
Gets the name the mySQL Server to which to connect. |
string |
HostInfo
Gets a string representing the server host name and the connection type. |
int |
ProtocolVersion
Gets an integer representing the protocol version used by current connection. |
string |
ServerVersion
Gets a string containing the version of the mySQL Server to which the client is connected. |
System.Data.ConnectionState |
State
Gets the current state of the connection. |
Method Summary | |
---|---|
System.Data.IDbTransaction |
BeginTransaction(System.Data.IsolationLevel iso) This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. |
System.Data.IDbTransaction |
BeginTransaction() This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. |
void |
ChangeDatabase(string database) Changes the current database for an open MySqlSharp.Provider.MySqlConnection. |
void |
Close() Closes the connection to the database. This is the preferred method of closing any open connection. |
System.Data.IDbCommand |
CreateCommand() This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. |
MySqlSharp.Provider.MySqlCommand |
CreateCommand() Creates and returns a MySqlSharp.Provider.MySqlCommand object associated with the MySqlSharp.Provider.MySqlConnection. |
void |
Dispose() Releases the unmanaged resources used by the MySqlSharp.Provider.MySqlConnection. |
void |
Open() Opens a database connection with the property settings specified by the MySqlSharp.Provider.MySqlConnection.ConnectionString. If no DataSource is specified, named pipes are used to connect to a local server. |
Methods inherited from class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString |
Constructor Detail |
---|
public MySqlConnection()
Initializes a new instance of the MySqlSharp.Provider.MySqlConnection class.
When a new instance of MySqlSharp.Provider.MySqlConnection is created, the read/write properties are set to the following initial values. Properties - Initial value
public MySqlConnection(string connectionString)
Initializes a new instance of the MySqlSharp.Provider.MySqlConnection class when given a string containing the connection string.
When a new instance of MySqlSharp.Provider.MySqlConnection is created, the read/write properties are set to the following initial values unless they are specifically set using their associated keywords in the MySqlSharp.Provider.MySqlConnection.ConnectionString property. Properties - Initial value
connectionString
- The connection parameters used to open the mySQL databaseSystem.ArgumentException
- An invalid connection string argument has been supplied
or a required connection string argument has not been supplied.Property Detail |
---|
public string ConnectionString
Gets or sets the connection string used to open a connection with the mySql database.
Value:
System.ArgumentException
- An invalid connection string argument has been supplied
or a required connection string argument has not been supplied.public int ConnectionTimeout
Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.
Value:
public string Database
Gets the name of the current database or the database to be used once a connection is open.
Value:
public string DataSource
Gets the name the mySQL Server to which to connect.
Value:
public string HostInfo
Gets a string representing the server host name and the connection type.
Value:
System.InvalidOperationException
- The connection is closed.public int ProtocolVersion
Gets an integer representing the protocol version used by current connection.
Value:
System.InvalidOperationException
- The connection is closed.public string ServerVersion
Gets a string containing the version of the mySQL Server to which the client is connected.
Value:
System.InvalidOperationException
- The connection is closed.public System.Data.ConnectionState State
Gets the current state of the connection.
Value:
Method Detail |
---|
private System.Data.IDbTransaction BeginTransaction(System.Data.IsolationLevel iso)
This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
private System.Data.IDbTransaction BeginTransaction()
This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
public void ChangeDatabase(string database)
Changes the current database for an open MySqlSharp.Provider.MySqlConnection.
Parameters:
database
- The name of the database to use in place of the current database.System.InvalidOperationException
- The connection is not open.MySqlSharp.Provider.MySqlException
- Cannot change databases.public void Close()
Closes the connection to the database. This is the preferred method of closing any open connection.
private System.Data.IDbCommand CreateCommand()
This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
public MySqlSharp.Provider.MySqlCommand CreateCommand()
Creates and returns a MySqlSharp.Provider.MySqlCommand object associated with the MySqlSharp.Provider.MySqlConnection.
Returns:
public void Dispose()
Releases the unmanaged resources used by the MySqlSharp.Provider.MySqlConnection.
public void Open()
Opens a database connection with the property settings specified by the MySqlSharp.Provider.MySqlConnection.ConnectionString. If no DataSource is specified, named pipes are used to connect to a local server.
If the SqlConnection goes out of scope, it is not closed. Therefore, you must explicitly close the connection by calling MySqlSharp.Provider.MySqlConnection.Close or MySqlSharp.Provider.MySqlConnection.Dispose.
Throws:System.InvalidOperationException
- Connection is already open.MySqlSharp.Provider.MySqlException
- A connection-level error occurred while opening the connection.
|
.NET Framework Beta 2 |
|||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |